﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sto4a00
    {
		private string _plistid;
		private string _pid;
        private int? _productcode;
		private string _productname;
		private double _bordqty;
		private double _ordqty;
		private double _pqty;
		private double _accqty;
		private double _preqty;
		private double _accpreqty;
		private double _price;
		private double _sendprice;
		private double _cess;
		private double _ordamt;
		private double _accamt;
		private string _usercode;
		private string _listid;
		
        /// <summary>
        /// 订单编码
        /// </summary>
		public string Plistid
		{
			get { return _plistid;	 }
			set { _plistid=value;	}
		}
        /// <summary>
        /// 商品标识
        /// </summary>
		public string Pid
		{
			get { return _pid;	 }
			set { _pid=value;	}
		}
        /// <summary>
        /// 商品代码
        /// </summary>
		public int? Productcode
		{
			get { return _productcode;	 }
			set { _productcode=value;	}
		}
        /// <summary>
        /// 商品名称
        /// </summary>
		public string Productname
		{
			get { return _productname;	 }
			set { _productname=value;	}
		}
        /// <summary>
        /// 起订数量
        /// </summary>
		public double Bordqty
		{
			get { return _bordqty;	 }
			set { _bordqty=value;	}
		}
        /// <summary>
        /// 订货数量
        /// </summary>
		public double Ordqty
		{
			get { return _ordqty;	 }
			set { _ordqty=value;	}
		}
        /// <summary>
        /// 配货数量
        /// </summary>
		public double Pqty
		{
			get { return _pqty;	 }
			set { _pqty=value;	}
		}
        /// <summary>
        /// 实收数量
        /// </summary>
		public double Accqty
		{
			get { return _accqty;	 }
			set { _accqty=value;	}
		}
        /// <summary>
        /// 赠品数量
        /// </summary>
		public double Preqty
		{
			get { return _preqty;	 }
			set { _preqty=value;	}
		}
        /// <summary>
        /// 实收赠品
        /// </summary>
		public double Accpreqty
		{
			get { return _accpreqty;	 }
			set { _accpreqty=value;	}
		}
        /// <summary>
        /// 订购价
        /// </summary>
		public double Price
		{
			get { return _price;	 }
			set { _price=value;	}
		}
        /// <summary>
        /// 出货价
        /// </summary>
		public double Sendprice
		{
			get { return _sendprice;	 }
			set { _sendprice=value;	}
		}
        /// <summary>
        /// 税率
        /// </summary>
		public double Cess
		{
			get { return _cess;	 }
			set { _cess=value;	}
		}
        /// <summary>
        /// 订购金额
        /// </summary>
		public double Ordamt
		{
			get { return _ordamt;	 }
			set { _ordamt=value;	}
		}
        /// <summary>
        /// 收货金额
        /// </summary>
		public double Accamt
		{
			get { return _accamt;	 }
			set { _accamt=value;	}
		}
        /// <summary>
        /// 用户名
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
        /// <summary>
        /// 主键字段
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Sto4a00> GetSto4a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sto4a00> list = new List<Sto4a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sto4a00 model = GetSto4a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sto4a00 GetSto4a00ByDataRow(DataRow dr)
		{
			Sto4a00 model = new Sto4a00(); //实例化Sto4a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("plistid")&&!(dr["plistid"] is System.DBNull))  
				model.Plistid = ( string)dr["plistid"];
			if (dcc.Contains("pid")&&!(dr["pid"] is System.DBNull))  
				model.Pid = ( string)dr["pid"];
			if (dcc.Contains("productcode")&&!(dr["productcode"] is System.DBNull))  
				model.Productcode = ( int)dr["productcode"];
			if (dcc.Contains("productname")&&!(dr["productname"] is System.DBNull))  
				model.Productname = ( string)dr["productname"];
			if (dcc.Contains("bordqty")&&!(dr["bordqty"] is System.DBNull))  
				model.Bordqty = Convert.ToDouble(dr["bordqty"]);
			if (dcc.Contains("ordqty")&&!(dr["ordqty"] is System.DBNull))  
				model.Ordqty = Convert.ToDouble(dr["ordqty"]);
			if (dcc.Contains("pqty")&&!(dr["pqty"] is System.DBNull))  
				model.Pqty = Convert.ToDouble(dr["pqty"]);
			if (dcc.Contains("accqty")&&!(dr["accqty"] is System.DBNull))  
				model.Accqty = Convert.ToDouble(dr["accqty"]);
			if (dcc.Contains("preqty")&&!(dr["preqty"] is System.DBNull))  
				model.Preqty = Convert.ToDouble(dr["preqty"]);
			if (dcc.Contains("accpreqty")&&!(dr["accpreqty"] is System.DBNull))  
				model.Accpreqty = Convert.ToDouble(dr["accpreqty"]);
			if (dcc.Contains("price")&&!(dr["price"] is System.DBNull))  
				model.Price = Convert.ToDouble(dr["price"]);
			if (dcc.Contains("sendprice")&&!(dr["sendprice"] is System.DBNull))  
				model.Sendprice = Convert.ToDouble(dr["sendprice"]);
			if (dcc.Contains("cess")&&!(dr["cess"] is System.DBNull))  
				model.Cess = Convert.ToDouble(dr["cess"]);
			if (dcc.Contains("ordamt")&&!(dr["ordamt"] is System.DBNull))  
				model.Ordamt = Convert.ToDouble(dr["ordamt"]);
			if (dcc.Contains("accamt")&&!(dr["accamt"] is System.DBNull))  
				model.Accamt = Convert.ToDouble(dr["accamt"]);
			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
